﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FunDraw.usercontrols
{
    public partial class ToolGroup : System.Windows.Forms.Panel
    {
        private Color _BorderColor=Color.Gray;
        private int _TopBorderWidth = 0;
        private int _LeftBorderWidth=1;
        private int _RightBorderWidth=1;
        private int _BottomBorderWidth=0;
        private ButtonBorderStyle _borderstyle = ButtonBorderStyle.Solid;
        /// <summary>
        /// 边框颜色
        /// </summary>
        [Category("Custom"), Description("边框的颜色")]
        public Color BorderColor {
            get {
                return _BorderColor;
            }
            set
            {
                _BorderColor = value;
                Invalidate();
            }
        } 
        [Category("Custom"), Description("上边框的宽度")]
        public int TopBorderWidth
        {
            get
            {
                return _TopBorderWidth;
            }
            set
            {
                _TopBorderWidth = value;
                Invalidate();
            }
        } 
        [Category("Custom"), Description("上边框的宽度")]
        public int LeftBorderWidth {
            get
            {
                return _LeftBorderWidth;
            }
            set
            {
                _LeftBorderWidth = value;
                Invalidate();
            }
        }
        [Category("Custom"), Description("左边框的宽度")]
        public int RightBorderWidth 
        {
            get
            {
                return _RightBorderWidth;
            }
            set
            {
                _RightBorderWidth = value;
                Invalidate();
            }
        } 
        [Category("Custom"), Description("右边框的宽度")]
        public int BottomBorderWidth 
        {
            get
            {
                return _BottomBorderWidth;
            }
            set
            {
                _BottomBorderWidth = value;
                Invalidate();
            }
        } 
        [Category("Custom"), Description("下框样式")]
        public ButtonBorderStyle bs
        {
            get
            {
                return _borderstyle;
            }
            set
            {
                _borderstyle = value;
                Invalidate();
            }
        }
       

        public ToolGroup()
        {
            InitializeComponent();
        }
        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
            ControlPaint.DrawBorder(pe.Graphics, ClientRectangle,
                BorderColor, LeftBorderWidth, bs,
                BorderColor, TopBorderWidth, bs,
                BorderColor, RightBorderWidth, bs,
                BorderColor, BottomBorderWidth, bs);
        }

    }
}
